﻿<%--
   Copyright 2012 University of Southampton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExperimentTypes.aspx.cs" Inherits="uk.ac.soton.ses.layouts.ExperimentTypes" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <h3 class="HDCH3">Experiment Types</h3>
    <asp:GridView ID="view_ExperimentTypes" runat="server" AutoGenerateSelectButton="True" DataKeyNames="ID" EmptyDataText="No types defined" SelectedRowStyle-BackColor="#228822" SelectedRowStyle-ForeColor="White" />

    <p>Create a new experiment type: <asp:TextBox ID="txt_NewExperimentName" runat="server" />
    <asp:LinkButton ID="btn_NewExperimentType" runat="server" Text="Create" OnClick="btn_CreateNewType_Click" />
    <asp:Label ID="lbl_CreateExperimentTypeMessage" runat="server" />
    </p>

    <h3 class="HDCH3">Templates Linked To Type (select an experiment type)</h3>
    <div>
    <div class="LeftDiv">
        <p><b>Templates currently linked:</b></p>
        <asp:Label ID="label_Instructions" runat="server" Text="Please select a type from above" />
        <asp:GridView ID="view_LinkedTemplates" runat="server" EmptyDataText="No links" AutoGenerateColumns="false" DataKeyNames="ID">
            <Columns>
                <asp:HyperLinkField DataTextField="ID" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="/_layouts/HDC/ExperimentDetails.aspx?ID={0}" HeaderText="ID"/>
                <asp:BoundField DataField="Name" HeaderText="Name" />
                <asp:BoundField DataField="Description" HeaderText="Description" />
                <asp:ButtonField CommandName="Unlink" Text="Unlink =>" />
            </Columns>
        </asp:GridView>
    </div>

    <div class="RightDiv">
        <p><b>Templates available for linking:</b></p>
        <asp:GridView ID="view_NonLinkedExperiments" runat="server" DataKeyNames="ID" AutoGenerateColumns="false" >
            <Columns>
                <asp:ButtonField CommandName="Link" Text="<= Link" />
                <asp:HyperLinkField DataTextField="ID" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="/_layouts/HDC/ExperimentDetails.aspx?ID={0}" HeaderText="ID"/>
                <asp:BoundField DataField="Name" HeaderText="Name" />
                <asp:BoundField DataField="Description" HeaderText="Description" />
            </Columns>
        </asp:GridView> 
    </div>
    <div class="ClearFloats" />
    </div>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
